﻿using BCDto.Common.Payment.WeChatPayBill.WxPayBillDetail;
using BCDto.Common.Payment.WeChatPayBill.WxPayBillStatistics;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCDto.Common.Payment.WeChatPayBill
{
    /// <summary>
    /// 微信账单
    /// </summary>
    public class WxPayBillDto
    {
        /// <summary>
        /// 详细清单
        /// </summary>
        public List<WxPayBillDetailDto> Details { get; set; }
        /// <summary>
        /// 清单统计
        /// </summary>
        public WxPayBillStatisticsDto BillStatistics { get; set; }
        /// <summary>
        /// 合计统计
        /// </summary>
        /// <param name="statistics">清单统计</param>
        public void SumStatistics(WxPayBillStatisticsDto statistics)
        {
            this.BillStatistics.TradeOrderCount += statistics.TradeOrderCount;
            this.BillStatistics.PayOrderTotal += statistics.PayOrderTotal;
            this.BillStatistics.RefundTotal += statistics.RefundTotal;
            this.BillStatistics.RechargeRefundTotal += statistics.RechargeRefundTotal;
            this.BillStatistics.HandlingFeeTotal += statistics.HandlingFeeTotal;
            this.BillStatistics.OrderTotal += statistics.OrderTotal;
            this.BillStatistics.ActualReceiveTotal += statistics.ActualReceiveTotal;
            this.BillStatistics.ApplyRefundTotal += statistics.ApplyRefundTotal;
            this.BillStatistics.ApplyRefundCount += statistics.ApplyRefundCount;
            this.BillStatistics.TradeSuccessCount += statistics.TradeSuccessCount;
        }
    }
}
